Concurrent programming techniques utilize mutual-exclusion algorithms to avoid the simultaneous use of a common resource, such as a global variable, by “critical sections” of multiple different threads executing at the same time. A critical section is a user-defined piece of code, which may in some instances define a portion of code a thread accesses a common resource, access to which should be atomic (i.e., at any time, only one thread should execute the critical section). However, simply defining a critical section is not itself a mechanism or algorithm for mutual exclusion. That is, a thread (or “program” or “process”) can include a critical section without any mechanism or algorithm that implements mutual exclusion. As such, a developer may add code to the thread in accordance with a well-known mutual-exclusion algorithm to help ensure that no two threads execute their respective critical sections at the same time. The addition of this code avoids the situation where these threads simultaneously access a common resource, such as a shared variable or data structure. More generally, the addition of this code avoids the situation where the threads simultaneously execute their critical sections—without regard to whether or not critical sections of the threads access a common resource.
While there exist algorithms to enable mutual exclusion, these algorithms usually often not resilient against any failures that may occur within the computing device that executes the multiple threads. As such, these mutual-exclusion algorithms may be prone to failure in some scenarios.